{extend name="common/sns_layout" /}
{block name="style"}{/block}
{block name="sns_content"}
<div class="sidebar">
  {include file="member:snshome:sidebar_sharegoods" /}
</div>
<div class="left-content">
  <input type="hidden" id="rtype" value="<?php echo I('get.type');?>"/>
  <div class="goback">
    <a href="<?php echo url('member/snshome/shareglist');?>?type=<?php if (I('get.type') == 'like'){?>like<?php }else { ?>share<?php } ?>&mid=<?php echo $sharegoods_info['share_memberid'];?>">&#8249;&nbsp;返回全部商品</a>
  </div>
  <div class="snsgoods-info">
    <div class="title">
      <h3><?php echo $sharegoods_info['snsgoods_goodsname'];?></h3>
    </div>
    <div class="gcontainer">
      <div class="pic-module">
      <?php if($sharegoods_info['snsgoods_isfirst'] == false){?>
          <div class="prev <?php echo $sharegoods_info['snsgoods_islast']==true?'whole':'';?>" nc_type="imgflipover" data-param='{"id":"<?php echo $sharegoods_info['snsgoods_previd'];?>"}'></div>
          <?php }?>
          <?php if($sharegoods_info['snsgoods_islast'] == false){?>
          <div class="next <?php echo $sharegoods_info['snsgoods_isfirst']==true?'whole':'';?>" nc_type="imgflipover" data-param='{"id":"<?php echo $sharegoods_info['snsgoods_nextid'];?>"}'></div>
          <?php }?>
        <div class="good-img"> <img src="<?php echo cthumb($sharegoods_info['snsgoods_goodsimage'],1280,$sharegoods_info['snsgoods_storeid']);?>"/> </div>
      </div>
      <div class="handle-module">
        <div class="operate" id="likestat_<?php echo $sharegoods_info['share_goodsid'];?>"><span><i></i>
          <?php if($sharegoods_info['snsgoods_havelike'] == 1){echo 喜欢;} else{?>
          <a href="javascript:void(0);" nc_type="likebtn" data-param='{"gid":"<?php echo $sharegoods_info['share_goodsid'];?>"}' class="<?php echo $sharegoods_info['snsgoods_havelike']==1?'noaction':''; ?>"><?php echo 喜欢;?></a>
          <?php }?>
          </span> <em nc_type="likecount_<?php echo $sharegoods_info['share_goodsid'];?>"><?php echo $sharegoods_info['snsgoods_likenum'];?></em></div>
        <?php if ($relation == 3){?>
        	<!--//  主人自己-->
        <div class="btn set" nc_type="privacydiv" id="recordone_<?php echo $sharegoods_info['share_id'];?>"> <a href="javascript:void(0)" nc_type="privacybtn"><i></i><?php echo 设置;?></a>
          <ul nc_type="privacytab" style="display:none;" >
            <li nc_type="privacyoption" data-param='{"sid":"<?php echo $sharegoods_info['share_id'];?>","v":"0"}'><span class="<?php echo $sharegoods_info['share_privacy']==0?'selected':'';?>"><?php echo 公开;?></span></li>
            <li nc_type="privacyoption" data-param='{"sid":"<?php echo $sharegoods_info['share_id'];?>","v":"1"}'><span class="<?php echo $sharegoods_info['share_privacy']==1?'selected':'';?>"><?php echo 好友;?></span></li>
            <li nc_type="privacyoption" data-param='{"sid":"<?php echo $sharegoods_info['share_id'];?>","v":"2"}'><span class="<?php echo $sharegoods_info['share_privacy']==2?'selected':'';?>"><?php echo 隐私;?></span></li>
          </ul>
        </div>
        <?php if(I('get.type') != 'like'){?>
        <div class="btn buyer-show"><a href="javascript:void(0)" nctype="add_share" data-param="{'sid':'<?php echo $sharegoods_info['share_id'];?>', 'gid':'<?php echo $sharegoods_info['share_goodsid'];?>'}"><i></i><?php echo 买家秀;?></a></div>
        <?php }?>
        <?php } ?>
        <div class="btn"><a href="<?php echo $sharegoods_info['snsgoods_goodsurl'];?>" target="_blank"><strong><?php echo 查看详情;?></strong></a></div>
        <div class="price"><?php echo '&yen';?><?php echo $sharegoods_info['snsgoods_goodsprice'];?></div>
      </div>
    </div>
    <?php if (I('get.type') != 'like'){?><div class="share-content"><i></i><p><?php echo $sharegoods_info['share_content'];?><i></i></p></div><?php }?>
    <!-- 买家秀图片S -->
    <?php if(!empty($pic_list)){?>
    <div class="ap-pic-module"><div class="top"><span><?php echo 买家秀;?></span><h3><?php echo 上传了实物秀;?></h3></div>
    <div class="picture">
      <?php foreach ($pic_list as $val){?>
      <img src="<?php echo $val['ap_cover'];?>" />
      <?php }?>
    </div></div>
    <?php }?>
    <!-- 买家秀图片E -->
    <div class="interact-module"><span class="add-time"><?php if (I('get.type') == 'like'){echo @date('Y-m-d H:i',$sharegoods_info['share_likeaddtime']); }else {echo @date('Y-m-d H:i',$sharegoods_info['share_addtime']);}?></span>
      <ul>
        <li><a data-param='{"gid":"<?php echo $sharegoods_info['share_goodsid'];?>"}' nc_type="sharegoods" href="javascript:void(0);"><?php echo 分享;?><em>(<?php echo $sharegoods_info['snsgoods_sharenum'];?>)</em></a></li>
        <li><a href="javascript:void(0);" class="comment-btn"><?php echo 评论;?><em>(<?php echo $sharegoods_info['share_commentcount'];?>)</em></a></li>
      </ul>
    </div>
    <!-- 商品评论 -->
    <div class="comment-module">
      <div class="arrow"></div>
      <div id="tracereply_<?php echo $sharegoods_info['share_id'];?>" class="load-module"></div>
      <div style="clear: both;"></div>
    </div>
  </div>
</div>
<div class="clear"></div>
<script type="text/javascript">
//评论隐藏/显示
$(document).ready(function(){
  	$(".comment-btn").click(function(){
  	$(".comment-module").slideToggle(300);
  	});
});
document.onclick = function(){ $("#smilies_div").html(''); $("#smilies_div").hide();};
$(function(){
	//图片翻页
	$("[nc_type='imgflipover']").bind('click',function(){
	    var data = $(this).attr('data-param');
	    eval( "data = "+data);
	    var type = $("#rtype").val();
	    window.location.href="<?php echo url('/member/snshome/goodsinfo');?>?type="+type+"&mid=<?php echo $sharegoods_info['share_memberid'];?>&id="+data.id;
	});
	//评论加载
	$("#tracereply_<?php echo $sharegoods_info['share_id'];?>").load('<?php echo url('/member/snshome/commentlist');?>?type=1&mid=<?php echo $sharegoods_info['share_memberid'];?>&id=<?php echo $sharegoods_info['share_id'];?>');


	// 追加
	$('a[nctype="add_share"]').click(function(){
	    eval( "data_str = "+$(this).attr('data-param'));
		ajax_form('add_share', '上传宝贝买家秀', "<?php echo url('/member/snshome/add_share');?>?type=refresh&sid="+data_str.sid+"&gid="+data_str.gid, 580);
	});
});
</script>
{/block}